package model.utils;

import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

public class CalendarTable extends GregorianCalendar {
	private static final long serialVersionUID = 1L;
	SimpleDateFormat format;

	public CalendarTable(String format) {
		super.setTimeInMillis(super.getInstance().getTimeInMillis());
		this.format = new SimpleDateFormat(format);
	}

	public CalendarTable() {
		super.setTimeInMillis(super.getInstance().getTimeInMillis());
		this.format = new SimpleDateFormat("dd-MM-yyyy HH:mm");
	}

	@Override
	public String toString() {

		SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy HH:mm");
		String fechaEvento = format.format(this.getTime());
		return fechaEvento;
	}
}
